package com.app.designpatternslearn.behavior.mementopattern.code

class Originator {

    var state: String? = null

    fun saveStateToMemento():Memento = Memento(state)

    fun getStateFromMemento(memento: Memento?) {
        state = memento?.state
    }

    override fun toString(): String {
        return "Originator(state=$state)"
    }


}